package com.zky.group.grouporder.web;

import com.zky.common.utils.R;
import com.zky.group.grouporder.controller.OrderController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

@Controller
public class MemberWebController {

    @Autowired
    OrderController orderController;

    @GetMapping("/memberOrder.html")
    public String memberOrder(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum, Model model){
        Map<String,Object>page = new HashMap<>();
        page.put("page",pageNum.toString() );
        R r = orderController.listWithOrder(page);
        model.addAttribute("orders",r);
        return "memberOrder";
    }

}
